package org.rabbit.service;

import java.util.List;

import javax.annotation.Resource;
import javax.transaction.Transactional;

import org.rabbit.dao.ProductDao;
import org.rabbit.pojo.Product;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;

@Component
//配置 transaction 使用interfaceClass属性
@Service(interfaceClass=ProductService.class)
@Transactional
public class ProductServiceimpl implements ProductService{

	@Resource
	private ProductDao pd;
	
	
	@Override
	public List<Product> findAll() {
		List<Product> pl = pd.findAll();
		return pl;
	}

	@Override
	public Product findOneByPid(Integer pid) {
		
		return pd.findByPid(pid);
	}

}
